我們在前面的研究中分析了 x1xhlol 收集的 Claude Code 與 Cursor 設定檔,發現兩者反映出完全不同的設計哲學。今天我們將探討另一個重要的參考來源:AGENTS.md 統一配置規範。
在現行的 AI 程式開發環境中,不同的 AI 程式工具各自維護獨立的設定檔,這導致開發者往往需要在同一專案下維護多套幾乎相同的規範:
.cursorrules
– Cursor 專用配置.windsurfrules
– Windsurf 專用配置.clauderules
– Claude 相關工具配置CLAUDE.md
– Claude Code 專用配置.clinerules
– Cline 專用配置這樣的現狀不僅造成了維護成本的增加,也帶來了學習上的負擔。
AGENTS.md 的核心主張是:
"One file, any agent. Your codebase gets a universal voice that every AI coding tool can understand."
它希望建立一個跨工具通用的配置標準,讓不同的 AI 工具能夠共享同一套規範,從而:
/project-root/AGENTS.md # 專案級設定
/project-root/frontend/AGENTS.md # 子系統設定
~/.config/AGENTS.md # 個人偏好設定
透過符號連結(symlink)支援既有工具的無縫轉換:
mv .cursorrules AGENTS.md && ln -s AGENTS.md .cursorrules
mv CLAUDE.md AGENTS.md && ln -s AGENTS.md CLAUDE.md
一個典型的 AGENTS.md 檔案通常包含以下幾個核心區塊:
# MyApp Project
MyApp is a full-stack web application with TypeScript frontend and Node.js backend.
## Build & Commands
- Typecheck and lint everything: pnpm check
- Run tests: pnpm test --run --no-color
- Start development server: pnpm dev
## Code Style
- TypeScript: Strict mode with exactOptionalPropertyTypes
- Tabs for indentation (2 spaces for YAML/JSON/MD)
- Use descriptive variable/function names
- NEVER use @ts-expect-error or @ts-ignore
## Testing
- Vitest for unit testing
- Use expect(VALUE).toXyz(...) instead of storing in variables
- Test files: *.test.ts or *.spec.ts
使用者可依據專案需求彈性刪減或新增相關段落。